<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>发布商品</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico">
    <link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="css/animate.css" rel="stylesheet">
    <link href="css/plugins/summernote/summernote.css" rel="stylesheet">
    <link href="css/plugins/webuploader/webuploader.css" rel="stylesheet" type="text/css">
    <link href="css/plugins/fileinput/fileinput.css" rel="stylesheet" type="text/css"/>
    <link href="css/demo/webuploader-demo.css" rel="stylesheet" type="text/css">
    <link href="css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet">
    <link href="css/plugins/switchery/switchery.css" rel="stylesheet">
    <!--jsTree-->
    <link href="css/plugins/jsTree/style.min.css" rel="stylesheet" type="text/css">
    <!--dropzone-->
    <link href="css/plugins/dropzone/dropzone.css" rel="stylesheet" type="text/css">


    <style>
        /*#resizable { width: 150px; height: 150px; padding: 0.5em; text-align: center; display: table-cell; vertical-align:middle;}*/
        /*#resizable h3 { text-align: center; margin: 0; }*/
        .resizable img {
            width: 40% !important;
            height: 40% !important;
        }
    </style>
    <style>
        .goods-pic .file-preview {
            width: 350px;
        }

        .detail-video .file-preview {
            width: 350px;
        }

        .demo {
            overflow: auto;
            border: 1px solid silver;
            min-height: 100px;
        }

        input[required]:before {
            content: '*';
            color: red;
            margin-right: 5px;
        }

        .dropzone {
            padding: 0px;
            min-height: 100px;
            border: 1px solid #ddd;
            border-radius: 4px;
        }

        .sku-url-div {
            position: relative;
            width: 120px;
            height: 130px;
        }

        .drop-preview {
            /*固定底部*/
            position: absolute;
            bottom: 0;

            width: 120px;
            height: 120px;
        }

        .drop-a {
            /*固定顶部*/
            position: absolute;
            top: 0;
            margin: 0px 20px !important;
        }

        .dropzone .dz-preview .dz-image {
            border-radius: 1px;
            overflow: hidden;
            width: 85px;
            height: 85px;
            position: relative;
            display: block;
            z-index: 10;
        }
    </style>
    <!--人人店的CSS-->
    <link href="css/viarrd/goods_global.css" rel="stylesheet">
    <link href="css/style.css?v=4.1.0" rel="stylesheet">

    <!-- 全局js -->
    <script src="js/jquery.min.js?v=2.1.4"></script>
    <script src="js/bootstrap.min.js?v=3.3.6"></script>
    <script src="js/core.js"></script>
    <script src="js/plugins/layer/layer.min.js"></script>

    <!-- jQuery Validation plugin javascript-->
    <script src="js/plugins/validate/jquery.validate.min.js"></script>
    <script src="js/plugins/validate/messages_zh.min.js"></script>

    <!-- fileinput -->
    <script src="js/plugins/fileinput/fileinput.js"></script>
    <script src="js/plugins/fileinput/fileinput_locale_zh.js"></script>
    <!-- 日期layerDate plugin javascript -->
    <!-- <script src="js/plugins/layer/laydate/laydate.js"></script>
     <script src="js/demo/laydate-demo.js"></script>-->
    <!-- summernote -->
    <script src="js/plugins/summernote/summernote.min.js"></script>
    <script src="js/plugins/summernote/summernote-zh-CN.js"></script>
    <script src="js/demo/summernote-demo.js"></script>

    <!--jsTree-->
    <script src="js/plugins/jsTree/jstree.js"></script>
    <script src="js/plugins/jsTree/jstree.min.js"></script>
    <!--dropzone-->
    <script src="js/plugins/dropzone/dropzone.js"></script>


</head>

<body class="gray-bg">
<div style="width: 60%;
    margin-left: 20%;" class="row">
    <div><h4 style="text-align: center;color:#000000">产品线选择</h4></div>
    <div>
        <label class="col-sm-2">发布产品线</label>
        <div class="col-sm-2">
            <select id="cateType" name="cateType" style="height:31px;border-radius: 3px;border: solid 1px #ddd;">
                <option value="0">蜜哆哆</option>
                <option value="1">蜜雅阁</option>
                <option value="2">品牌馆</option>
            </select>
        </div>
    </div>
</div>
<div class="row" style="width: 60%;
    margin-left: 20%;">
    <!--<label>产品分类选择</label>-->
    <div><h4 style="text-align: center;color:#000000">分类选择</h4></div>
    <div class="form-group row">
        <!-- 搜索框 -->
        <div class="search_input col-sm-7">
            <input type="text" id="search_ay" placeholder="输入关键词自动搜索"/>
            <button id="btn_search" class="btn btn-default">搜索</button>
            <button id="btn_refresh_tree" type="button" class="btn btn-primary btn-sm"><i
                    class="glyphicon glyphicon-refresh"></i>
                刷新
            </button>
            <button type="button" class="btn btn-success btn-sm" onclick="lv1_create();"><i
                    class="glyphicon glyphicon-asterisk"></i>
                新建商品大类
            </button>
        </div>
    </div>
    <div id="jstree_demo" class="demo row"></div>
</div>
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <div class="goods-form">
                        <form class="form-horizontal m-t" id="goodsAddForm">
                            <div class="form-group">
                                <label style="font-size: 15px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;当前选择的商品分类为：<span
                                        id="curCatePath" style="color:#07d;">未选择分类</span></label>
                                <div class="model-head"><h5>基本信息</h5></div>
                                <div class="list-tr"
                                     ng-class="{'has-error': form.goods_title.$invalid &amp;&amp; form.goods_title.$dirty}">
                                    <label class="col-sm-3 control-label"><span class="text-danger">*</span>商品标题</label>
                                    <div class="list-td">
                                        <input id="id" name="id" style="display: none"/>
                                        <input type="text"
                                               id="goodsName"
                                               minlength="2"
                                               name="goodsName"
                                               class="form-control input-sm"
                                               placeholder="请输入商品标题" style="width:700px" required
                                               data-msg="商品标题不能为空，请至少输入两个字">
                                    </div>
                                </div>

                                <div id="title_div" class="form-group">
                                    <label class="col-sm-3 control-label"><span class="text-danger">*</span>价格</label>
                                    <div class="col-sm-8">
                                        <input id="mPrice" name="mPrice" type="text"
                                               class="form-control numbersOnly" required data-msg="商品价格不能为空,且必须为数字">
                                    </div>
                                </div>
                                <!--    <div data-url="" class="sku-url-div dropzone" name="file" style="display:none">
                                        <div id="previews" class="dropzone-previews drop-preview"></div>
                                        <a class="upload_sku_pic btn btn-inline btn-sm dz-message drop-a">上传图片</a>
                                    </div>
                                    <script type="text/javascript">
                                        Dropzone.autoDiscover = false;//解决两次实例Dropzone错误，可在控制台看到该错误
                                        $(".sku-url-div").dropzone({
                                            url: urlcore + "/api/attachment/upload",
    //                                        paramName: "skuUrl", // The name that will be used to transfer the file
                                            maxFiles: 1,
                                            clickable: true,
                                            thumbnailWidth:100,
                                            thumbnailHeight:100,
                                            previewsContainer: "#previews", // 指定存放文件队列区
                                            addRemoveLinks: true,//清除图片
                                            success: function (file, data) {
                                                console.log($(this));
                                                console.log("file:", file);
                                                console.log("data:", data);
                                                var skuUrl = data.data[0];
                                                console.log("sku-url:", skuUrl);
                                                $(this).attr("data-url", skuUrl);
                                                alert($(this).attr("data-url"));
                                            },
                                            init: function () {
                                                this.on("addedfile", function (file) {
                                                    alert(1);// actions...
                                                });
                                            },
                                        });

                                    </script>-->
                                <div id="title_div" class="form-group">
                                    <label class="col-sm-3 control-label">其他市场价</label>
                                    <div class="col-sm-8">
                                        <input id="otherPrice" name="otherPrice" type="text"
                                               class="form-control numbersOnly">
                                    </div>
                                </div>
                                <div id="returnRateDiv" class="form-group">
                                    <label class="col-sm-3 control-label"><span
                                            class="text-danger">*</span>哆币返现比例(%)</label>
                                    <div class="col-sm-8">
                                        <input id="returnRate" name="returnRate" type="text"
                                               class="form-control numbersOnly" value="20" required>
                                    </div>
                                    <label class="col-sm-3 control-label"><span
                                            class="text-danger">*</span>雅币返现比例(%)</label>
                                    <div class="col-sm-8">
                                        <input id="returnRateY" name="returnRateY" type="text"
                                               class="form-control numbersOnly" value="30" required>
                                    </div>
                                </div>

                                <div class="form-group ">
                                    <div class="col-sm-3 control-label">
                                        <label>
                                            <input class="ifUniformRadio" type="radio" name="ifUniformSpec"
                                                   value="0" style="" checked="checked"> 统一规格</label>
                                        <label>
                                            <input class="ifUniformRadio" type="radio" name="ifUniformSpec"
                                                   value="1" style=""> 多规格</label>
                                    </div>
                                </div>
                                <div id="MultiSpec" class="form-group" style="margin-left: 10%;display: none">
                                    <!--     <div class="form-group ">
                                             <div class="col-sm-3 control-label">
                                                 <a id="addSpec" style="display: none">添加规格</a>
                                             </div>
                                         </div>-->
                                    <div id="addProp" class="">
                                        <div class=""><input type="text" class="form-control input-sm input-addSku-name"
                                                             id="input-addSku-name" placeholder="请输入规格名称">
                                        </div>
                                        <div class="">
                                            <div class="form-inline"><input type="text"
                                                                            class="form-control input-sm input-addSku-name"
                                                                            id="input-addSku-value"
                                                                            placeholder="请输入规格值">
                                                <button type="button" class="btn btn-default btn-sm"
                                                        id="btn_addTempSkuValue">添加
                                                </button>
                                                <div class="clearfix">
                                                </div>
                                            </div>
                                            <!--<p class="remark">输入回车即可直接添加</p>-->
                                            <!-- ngRepeat: value in vm.skuValueTemp track by $index --></div>
                                        <div class="form-inline">
                                            <button id="btn_addSku" type="button" class="btn btn-success btn-sm">添加规格
                                            </button>
                                            <button type="button" class="btn btn-default btn-sm"
                                                    onclick="cancelAddSku()">取消
                                            </button>
                                        </div>
                                    </div>
                                    <!-- <div data-pid="1" class="sku-list item ">给我热
                                         <a class="btn_editSku btn btn-inline btn-sm ">编辑</a>
                                         <a class="btn_delSku btn btn-inline btn-sm "
                                            placement="right" maximize="true">删除</a>
                                         <ul class="sku-tree">
                                             <li>
                                                 <label data-vid="2" class="label label-init">
                                                     特瑞
                                                 </label>
                                             </li>
                                             <li>
                                                 <label data-vid="3" class="label label-init">
                                                     突然
                                                 </label>
                                             </li>
                                         </ul>
                                     </div>-->
                                    <div class="sku-list item edit-whole-div" style="display: none">
                                        <span id="editSpanPname"></span>
                                        <div id="editProp" class="">
                                            <div class=""><input type="text"
                                                                 class="form-control "
                                                                 id="input-editSku-name">
                                            </div>
                                            <div class="">
                                                <div class="form-inline"><input type="text"
                                                                                class="form-control"
                                                                                id="input-editSku-value"
                                                                                placeholder="请输入规格值">
                                                    <button type="button" class="btn btn-default btn-sm"
                                                            id="btn_addEditTempSkuValue">添加
                                                        <!--id="btn_addTempSkuValue">添加-->
                                                    </button>
                                                    <div class="clearfix">
                                                        <!--        <label class="label label-init"
                                                                       data-pid="1"><a class="ng-scope"><i
                                                                        class="fa fa-remove"></i></a>特瑞</label>
                                                                <label
                                                                        class="label label-init"
                                                                        ng-repeat="val in vm.skuEditTemp[$index].prop_values track by $index"
                                                                        data-pid="1"><a><i class="fa fa-remove"></i></a>
                                                                    &lt;!&ndash; end ngIf: val.merchant_id != 0 &ndash;&gt; 突然</label>
                                                                &lt;!&ndash; end ngRepeat: val in vm.skuEditTemp[$index].prop_values track by $index &ndash;&gt;-->
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-inline">
                                                <button id="btn_EditSku" type="button" class="btn btn-success btn-sm">
                                                    修改规格
                                                </button>
                                                <button type="button" class="btn btn-default btn-sm"
                                                        onclick="cancelEditSku()">取消
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="list-tr js-test">
                                        <div>价格&amp;库存
                                            <div class="list-td" style="margin-left: auto">
                                                <table id="skuTable" class="sku-table table js-sku-table ng-scope">
                                                    <!--             <thead>
                                                                 <tr>
                                                                     <td class="thead-sku-id" style="display: none"></td>
                                                                     <td class="thead-sku-prop-str" style="display: none"></td>
                                                                     <td class="thead-prop-name">bbbg</td>
                                                                     <td>商品图片</td>
                                                                     <td>价格</td>
                                                                     <td>库存</td>
                                                                     <td width="80">删除操作</td>
                                                                 </tr>
                                                                 </thead>
                                                                 <tbody>
                                                                 <tr class="js-sku-content">
                                                                     <td class="td-sku-id" style="display: none">2</td>
                                                                     <td class="td-sku-prop-str" style="display: none">1-2,3-6,2-5</td>
                                                                     <td class="td-prop-value">bb</td>
                                                                     <td class="sku-url"></td>
                                                                     <td>
                                                                         <div class="validator-form">
                                                                             <input custom-number="" decimal="2"
                                                                                    class="form-control input-sm sku-price-input ng-pristine ng-untouched ng-isolate-scope ng-invalid ng-invalid-custom-number"
                                                                                    type="text" name="sku_price" value=""
                                                                                    style=""></div>
                                                                     </td>
                                                                     <td>
                                                                         <div class="validator-form">
                                                                             <input custom-number=""
                                                                                    class="form-control input-sm sku-stock-input ng-pristine ng-untouched ng-isolate-scope ng-invalid ng-invalid-custom-number"
                                                                                    type="text" name="sku_inventory" value=""
                                                                                    style=""></div>
                                                                     </td>
                                                                     <td class="remove-a-sku"><a placement="bottom"
                                                                                                 maximize="true"><i
                                                                             class="fa fa-remove"></i></a>
                                                                     </td>
                                                                 </tr>
                                                                 </tbody>-->
                                                </table>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div id="UniformSpec">
                                    <!--            <div class="form-group">
                                                    <div class="col-sm-3 control-label">统一价格</div>
                                                    <div class="list-td">
                                                        <div class="input-group input-group-sm ">
                                                        <span><span>￥</span>
                                                            <input id="uniformPrice" type="text" class="form-control"
                                                                   name="price"
                                                                   decimal="2">
                                                    </span>
                                                        </div>
                                                    </div>
                                                </div>-->
                                    <div class="form-group">
                                        <div class="col-sm-3 control-label"><span class="text-danger">*</span>库存</div>
                                        <div class="list-td">
                                            <div class="input-group input-group-sm">
                                                <input id="uniformInventory" type="text"
                                                       class="form-control numbersOnly"
                                                       name="inventory" required>
                                                <span>件</span></div>
                                        </div>
                                    </div>
                                </div>
                                <div id="jiu_picture_div" class="form-group" style="display: none;">
                                    <label class="col-sm-3 control-label">旧活动图：</label>
                                    <div class="col-sm-8">
                                        <span id="goodsUrl" name="goodsUrl" class="footable-sort-indicator"></span>
                                    </div>
                                </div>
                                <div class="form-group goods-pic">
                                    <label class="col-sm-3 control-label"><span class="text-danger">*</span>上传主图片(一张)：</label>
                                    <div class="col-sm-8">
                                        <!--<div class="ibox-content">-->
                                        <div class="page-container">
                                            <input type="file" id="file_upload" name="file">
                                        </div>
                                        <!-- </div>-->
                                    </div>
                                    <span style="display: none;" id="uploadSuccessImg"></span>
                                </div>
                                <div class="model-head"><h5>商品详情</h5></div>
                                <div id="jiu_picture_div" class="form-group" style="display: none;">
                                    <label class="col-sm-3 control-label">旧banner图：</label>
                                    <div class="col-sm-8">
                                        <span id="picturesUrl" name="picturesUrl"
                                              class="footable-sort-indicator"></span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label"><span class="text-danger">*</span>上传多张详情banner图：</label>
                                    <div class="col-sm-8">
                                        <div class="page-container">
                                            <input type="file" id="fileupload2" name="file">
                                        </div>
                                    </div>
                                    <span style="display: none;" id="uploadSuccessImg"></span>
                                </div>

                                <div id="jiu_picture_div" class="form-group" style="display: none;">
                                    <label class="col-sm-3 control-label">旧详情视频：</label>

                                    <div class="col-sm-8">
                                        <span id="videoUrl" name="videoUrl" class="footable-sort-indicator"></span>
                                    </div>
                                </div>
                                <div class="form-group detail-video">
                                    <label class="col-sm-3 control-label">详情视频（不超过50M）：</label>

                                    <div class="col-sm-8">
                                        <!--<div class="ibox-content">-->
                                        <div class="page-container">

                                            <input type="file" id="fileupload3" name="file">
                                        </div>
                                        <!-- </div>-->
                                    </div>
                                    <span style="display: none;" id="uploadSuccessImg"></span>
                                    <label class="col-sm-3 control-label"></label>
                                    <div class="list-td">
                                        <input custom-required="" type="input" ng-model="vm.goodsData.title"
                                               id="onlineVideo"
                                               class="form-control input-sm "
                                               placeholder="或贴入网络视频地址" style="width:600px">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-3 control-label"><span class="text-danger">*</span>商品介绍</label>
                                    <div class="col-sm-8">
                                        <!--<div class="ibox-content">-->
                                        <div class="page-container">
                                            <div id="goodsDetailId" name="goodsDetailId" style="display:none"></div>
                                            <div class="summernote" id="goodsIntroduce" name="goodsIntroduce"
                                                 style="width:300px;!important;"></div>
                                        </div>
                                        <!-- </div>-->
                                    </div>
                                </div>

                                <div id="title_div" class="form-group">
                                    <label class="col-sm-3 control-label">商品备注</label>
                                    <div class="col-sm-8">
                                        <input id="goodsRemarks" name="goodsRemarks" type="text"
                                               class="form-control">
                                    </div>
                                </div>

                                <div class="model-head"><h5>物流/其他</h5></div>
                                <div id="title_div" class="form-group">
                                    <label class="col-sm-3 control-label"><a href="delivery_plan_add.html" style="text-decoration: underline">添加邮费方案</a><span
                                            class="text-danger">*</span>邮费方案</label>
                                    <div class="col-sm-8">
                                        <select id="postage" name="postage"
                                                style="height:31px;border-radius: 3px;border: solid 1px #ddd;">
                                            <!--<option value="1">江浙沪包邮</option>-->
                                        </select>
                                    </div>
                                </div>
                                <div id="title_div" class="form-group">
                                    <label class="col-sm-3 control-label"><span
                                            class="text-danger">*</span>邮费增加（超重超大等）</label>
                                    <div class="col-sm-8">
                                        <input id="overDeliveryPostage" name="overDeliveryPostage" type="number"
                                               class="form-control" value="0" required>
                                    </div>
                                </div>
                                <div id="title_div" class="form-group">
                                    <label class="col-sm-3 control-label">前端邮费显示名称</label>
                                    <div class="col-sm-8">
                                        <input id="gtOnePostage" name="gtOnePostage" type="text"
                                               class="form-control">
                                    </div>
                                </div>
                                <div class="form-group ">
                                    <div class="col-sm-3 control-label">购买特权</div>
                                    <div class="list-td">
                                        <label>
                                            <input type="radio" name="rainbow_only"
                                                   value="0" style="" checked="checked">全部会员可购买</label>
                                        <label>
                                            <input type="radio" name="rainbow_only"
                                                   value="1" style="">彩虹会员才能购买</label>
                                    </div>
                                </div>
                                <div class="form-group ">
                                    <div class="col-sm-3 control-label">是否发布</div>
                                    <div class="list-td">
                                        <label>
                                            <input class="goods_status" type="radio" name="goods_status"
                                                   value="1" style="" checked="checked">只上传不发布</label>
                                        <label>
                                            <input class="goods_status" type="radio" name="goods_status"
                                                   value="2" style="">上传同时发布</label>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-sm-4 col-sm-offset-3">
                                        <button class="btn btn-primary" type="button" onclick="onSave()">上传</button>
                                        <button class="btn btn-primary" type="reset" onclick="clear()">重置</button>
                                        <!--<button class="btn btn-primary" type="button" onclick="test()">测试</button>-->
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

</div>

<!--<div id="title_div" class="form-group">
    <label class="col-sm-3 control-label"><a
            class="btn_preview_detail btn btn-inline btn-sm">预览介绍</a></label>
    <div id="preview" class="col-sm-8" style="width:500px!important;height:800px!important;background-color: #00FF00;">

    </div>
</div>-->
<!--引入树-->
<script src="js/goods_category.js"></script>

<!-- 自定义js -->
<script src="js/goods_add.js"></script>
</body>
</html>
